<%@ include file="/WEB-INF/html/skillManagement/common/init.jsp" %>

<%
ResultRow row = (ResultRow)request.getAttribute(com.liferay.portal.kernel.util.WebKeys.SEARCH_CONTAINER_RESULT_ROW);
SkillCategory category = (SkillCategory)row.getObject();

String backURLString = PortalUtil.getCurrentCompleteURL(request);
%>

<liferay-ui:icon-menu >
	<c:if test="<%= SkillCategoryPermissionUtil.contains(permissionChecker, category, SkillUserActions.UPDATE) %>">
		<liferay-portlet:renderURL varImpl="editURL" >
			<portlet:param name="struts.portlet.action" value="/view/editSkillCategory" />
			<portlet:param name="<%= WebKeys.SKILL_CAT_ID_PARAM %>" value="<%= String.valueOf(category.getId()) %>" />
			<portlet:param name="backURL" value="<%= backURLString %>"/>
		</liferay-portlet:renderURL>
		
		<liferay-ui:icon image="edit" url="<%= editURL.toString() %>" />
	</c:if>

	<c:if test="<%= SkillCategoryPermissionUtil.contains(permissionChecker, category, SkillUserActions.DELETE) %>">
		<liferay-portlet:renderURL varImpl="deleteURL" >
			<portlet:param name="struts.portlet.action" value="/view/deleteSkillCategory" />
			<portlet:param name="<%= WebKeys.SKILL_CAT_ID_PARAM %>" value="<%= String.valueOf(category.getId()) %>" />
		</liferay-portlet:renderURL>

		<liferay-ui:icon-delete url="<%= deleteURL.toString() %>" />
	</c:if>
</liferay-ui:icon-menu>